package com.theta.gateway.infra.routecfg.model.dataobject.response;

import java.util.List;

import com.google.common.collect.Lists;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class RouteInfoDO {
	/**
	 * 路由ID
	 */
	private String routeId;
	/**
	 * 转发地址
	 */
	private String uri;
	/**
	 * 断言
	 */
	private List<RouteInfoPredicateDO> predicates;
	/**
	 * 过滤器
	 */
	private List<RouteInfoFilterDO> filters;
	/**
	 * 顺序号
	 */
	private Integer order;
	
	
	public void addPredicate(RouteInfoPredicateDO predicate) {
		if(this.predicates==null)this.predicates=Lists.newArrayList();
		this.predicates.add(predicate);
	}
	
	public void addFilter(RouteInfoFilterDO filter) {
		if(this.filters==null)this.filters=Lists.newArrayList();
		this.filters.add(filter);
	}

}
